#include "uart.h"

void uart_init(int buadrate)
{
    uart_config_t uart_init_struct;

    uart_init_struct.baud_rate=buadrate;
    uart_init_struct.data_bits=UART_DATA_8_BITS;
    uart_init_struct.parity=UART_PARITY_DISABLE;
    uart_init_struct.stop_bits=UART_STOP_BITS_1;
    uart_init_struct.flow_ctrl=UART_HW_FLOWCTRL_DISABLE;
    uart_init_struct.source_clk=UART_SCLK_DEFAULT;

    uart_param_config(UART_UX,&uart_init_struct);

    uart_set_pin(UART_UX,UART_TX,UART_RX,UART_PIN_NO_CHANGE,UART_PIN_NO_CHANGE);
    uart_driver_install(UART_UX,UART_BUFF_SIZE,UART_BUFF_SIZE,0,NULL,0);
}